/*
 * Project Name: cms_manager
 * File Name: VideoService.java
 * Copyright: ZKTeco Corporation 2015
 * Description: TODO 请在此处添加对本文件的描述
 * Creator: Administrator
 * Create Date: 2015年3月18日 下午3:54:02
 */
package com.shishuo.cms.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shishuo.cms.dao.VideoDao;
import com.shishuo.cms.entity.VideoEntity;
import com.shishuo.cms.entity.vo.PageVo;
import com.shishuo.cms.vo.VideoEntityVo;

/**
 * 
 * @since 2015年3月18日 下午3:54:02
 */
@Service
public class VideoService extends BaseService<VideoEntity, Long>
{
	private VideoDao videoDao;

	@Autowired
	public void setVideoDao(VideoDao videoDao)
	{
		super.setBaseDao(videoDao);
		this.videoDao = videoDao;
	}
	public PageVo<VideoEntity> getAllListPage(int pageNum) throws Exception{
		PageVo<VideoEntity> pageVo = new PageVo<VideoEntity>(pageNum);
		List<VideoEntity> list = this
				.getAllList(pageVo.getOffset(), pageVo.getRows());
		pageVo.setList(list);
		pageVo.setCount(this.getAllListCount());
		return pageVo;
	}
	public PageVo<VideoEntityVo> getAllListPageByClassId(int pageNum, long classId) throws Exception {
		PageVo<VideoEntityVo> pageVo = new PageVo<VideoEntityVo>(pageNum);
		List<VideoEntityVo> list =  videoDao.getAllListPageByClassId(pageNum,10,classId);
		pageVo.setList(list);
		pageVo.setCount(this.getAllListCount());
		return pageVo;
	}

}
